home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / libsrc11.arc / WRBLKEE.C < prev    next >
C/C++ Source or Header  |  1989-04-27  |  1KB  |  46 lines

  1. /*    wrblkee.c 4.2        */
  2. /*F****************************************************************************
  3.  
  4. FUNCTION NAME:    wrblkee
  5.  
  6. ACTION:        Program multiple bytes in EEPROM at address provided.
  7.         If address is -1, then the 68HC11 "Config" register is 
  8.         programmed before other cells in EEPROM are programmed.
  9.  
  10. PARAMETERS:
  11.         addr:    offset into EEPROM.  This value can be 0 through
  12.             the size of EEPROM or -1.  If it is -1, the Config
  13.             register is to be programmed.
  14.  
  15.         array:    pointer to an array of bytes that contain the values
  16.             that EEPROM are to be programmed from.
  17.  
  18.         count:    number of bytes to program.
  19.  
  20. RETURNS:    (void)
  21.  
  22. ******************************************************************************/
  23.  
  24. #include <hc11/directives.h>
  25.  
  26. SMALL
  27. void wrblkee(addr, array, count)
  28.  
  29.     int        addr;        /* location(s) to be programmed */
  30.     unsigned short    *array;        /* pointer to data to be programmed */
  31.     int        count;        /* number of bytes to be programmed */
  32.  
  33.     {
  34.  
  35.     /****************************************************************/
  36.     /*    Note that "while ((count--) > 0)" is equivalent to    */
  37.     /*    "while ((--count) >= 0)" but the pre-decrement        */
  38.     /*    version is more efficient than the post-decrement    */
  39.     /*    verison.                        */
  40.     /****************************************************************/
  41.  
  42.     while ((--count) >= 0)
  43.         wrbytee(addr++, (unsigned) *(array++));
  44.  
  45.     }    /* end of wrblkee */
  46.